package com.guguskins.back.service;

import com.guguskins.back.mapper.GuPermissionMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class GuPermssionService
{
    @Autowired
    private GuAdminUserService adminUserService;
    @Autowired
    private GuPermissionMapper permissionMapper;
    @Test
    public void selectPermissionValueByUserId() {
        List<String> selectPermissionValueList = null;
        if (adminUserService.isSysAdmin(2)) {
            //如果是系统管理员，获取所有权限
            selectPermissionValueList = permissionMapper.selectAllPermissionValue();
        } else {
            selectPermissionValueList = permissionMapper.selectPermissionValueByUserId(1);
        }
        System.out.println(selectPermissionValueList.toString());
    }

}
